1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.ScrollableIF;
26 
27 private import glib.MemorySlice;
28 private import gobject.ObjectG;
29 private import gtk.Adjustment;
30 private import gtk.Border;
31 private import gtk.c.functions;
32 public  import gtk.c.types;
33 
34 
35 /**
36  * `GtkScrollable` is an interface for widgets with native scrolling ability.
37  * 
38  * To implement this interface you should override the
39  * [property@Gtk.Scrollable:hadjustment] and
40  * [property@Gtk.Scrollable:vadjustment] properties.
41  * 
42  * ## Creating a scrollable widget
43  * 
44  * All scrollable widgets should do the following.
45  * 
46  * - When a parent widget sets the scrollable child widget’s adjustments,
47  * the widget should connect to the [signal@Gtk.Adjustment::value-changed]
48  * signal. The child widget should then populate the adjustments’ properties
49  * as soon as possible, which usually means queueing an allocation right away
50  * and populating the properties in the [vfunc@Gtk.Widget.size_allocate]
51  * implementation.
52  * 
53  * - Because its preferred size is the size for a fully expanded widget,
54  * the scrollable widget must be able to cope with underallocations.
55  * This means that it must accept any value passed to its
56  * [vfunc@Gtk.Widget.size_allocate] implementation.
57  * 
58  * - When the parent allocates space to the scrollable child widget,
59  * the widget must ensure the adjustments’ property values are correct and up
60  * to date, for example using [method@Gtk.Adjustment.configure].
61  * 
62  * - When any of the adjustments emits the [signal@Gtk.Adjustment::value-changed]
63  * signal, the scrollable widget should scroll its contents.
64  */
65 public interface ScrollableIF{
66 	/** Get the main Gtk struct */
67 	public GtkScrollable* getScrollableStruct(bool transferOwnership = false);
68 
69 	/** the main Gtk struct as a void* */
70 	protected void* getStruct();
71 
72 
73 	/** */
74 	public static GType getType()
75 	{
76 		return gtk_scrollable_get_type();
77 	}
78 
79 	/**
80 	 * Returns the size of a non-scrolling border around the
81 	 * outside of the scrollable.
82 	 *
83 	 * An example for this would be treeview headers. GTK can use
84 	 * this information to display overlaid graphics, like the
85 	 * overshoot indication, at the right position.
86 	 *
87 	 * Params:
88 	 *     border = return location for the results
89 	 *
90 	 * Returns: %TRUE if @border has been set
91 	 */
92 	public bool getBorder(out Border border);
93 
94 	/**
95 	 * Retrieves the `GtkAdjustment` used for horizontal scrolling.
96 	 *
97 	 * Returns: horizontal `GtkAdjustment`.
98 	 */
99 	public Adjustment getHadjustment();
100 
101 	/**
102 	 * Gets the horizontal `GtkScrollablePolicy`.
103 	 *
104 	 * Returns: The horizontal `GtkScrollablePolicy`.
105 	 */
106 	public GtkScrollablePolicy getHscrollPolicy();
107 
108 	/**
109 	 * Retrieves the `GtkAdjustment` used for vertical scrolling.
110 	 *
111 	 * Returns: vertical `GtkAdjustment`.
112 	 */
113 	public Adjustment getVadjustment();
114 
115 	/**
116 	 * Gets the vertical `GtkScrollablePolicy`.
117 	 *
118 	 * Returns: The vertical `GtkScrollablePolicy`.
119 	 */
120 	public GtkScrollablePolicy getVscrollPolicy();
121 
122 	/**
123 	 * Sets the horizontal adjustment of the `GtkScrollable`.
124 	 *
125 	 * Params:
126 	 *     hadjustment = a `GtkAdjustment`
127 	 */
128 	public void setHadjustment(Adjustment hadjustment);
129 
130 	/**
131 	 * Sets the `GtkScrollablePolicy`.
132 	 *
133 	 * The policy determines whether horizontal scrolling should start
134 	 * below the minimum width or below the natural width.
135 	 *
136 	 * Params:
137 	 *     policy = the horizontal `GtkScrollablePolicy`
138 	 */
139 	public void setHscrollPolicy(GtkScrollablePolicy policy);
140 
141 	/**
142 	 * Sets the vertical adjustment of the `GtkScrollable`.
143 	 *
144 	 * Params:
145 	 *     vadjustment = a `GtkAdjustment`
146 	 */
147 	public void setVadjustment(Adjustment vadjustment);
148 
149 	/**
150 	 * Sets the `GtkScrollablePolicy`.
151 	 *
152 	 * The policy determines whether vertical scrolling should start
153 	 * below the minimum height or below the natural height.
154 	 *
155 	 * Params:
156 	 *     policy = the vertical `GtkScrollablePolicy`
157 	 */
158 	public void setVscrollPolicy(GtkScrollablePolicy policy);
159 }